<html>
<head>
<title>Processing order............</title>
<?php echo $html->script(array("jquery.min.js"));?>
<script type="text/javascript">
 jQuery.noConflict();
jQuery(document).ready(function(){
	//jQuery("body").css("opacity","0.15");
	jQuery("#loader_cart").css("z-index","100");
	jQuery("#loader_cart").show("200");
	javascript:document.forms.paypal_ipn.submit();
});		
</script>
</head> 
<!--onload="javascript:document.forms.paypal_ipn.submit();" style="display:block;"-->
<body style="display:block;">
<div id="loader_cart" style="left: 392px;position: absolute;top: 203px;">
<img src="<?php echo Configure::read('base_url');?>img/animation_processing.gif" alt="Processing Cart..." style="" />
</div>
<?php if($paymentsGateway['Paymentmethod']['state']=="live"){?>
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" name="paypal_ipn" id="paypal_ipn">
<?php }else {?>
<form method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" name="paypal_ipn" id="paypal_ipn">
<?php }?>
	<div class="paypal-form">
		<input type="hidden" value="<?php echo $paymentsGateway['Paymentmethod']['email'];?>" name="business">
		<input type="hidden" value="<?php echo Configure::read('base_url');?>orders/incoming_ipn" name="notify_url">
		<input type="hidden" value="<?php echo Configure::read('base_url');?>carts/view_cart" name="cancel_return">
		<input type="hidden" value="USD" name="currency_code">
		<input type="hidden" value="US" name="lc">
		<?php $i=1;foreach($carts as $cart){?>
		<input type="hidden" value="<?php echo $cart[0]['Cart']['product_id'];?>" name="item_number_<?php echo $i;?>">
		<input type="hidden" value="<?php echo $cart[0]['Cart']['quantity'];?>" name="quantity_<?php echo $i;?>">
		<input type="hidden" value="<?php echo $cart[0]['Product']['products_title'];?>" name="item_name_<?php echo $i;?>">
		<input type="hidden" value="<?php echo $cart[0]['Cart']['product_cost'];?>" name="amount_<?php echo $i;?>">
		<input type="hidden" value="<?php echo $cart[0]['Cart']['sales_tax'];?>" name="tax_<?php echo $i;?>">
		<!--input type="hidden" name="weight_<?php echo $i;?>" value="<?php echo $cart[0]['Product']['products_weight'];?>"--> 
		<?php $i++;}?>
		<input type="hidden" value="<?php echo $custom;?>" name="custom">		
		<input type="hidden" value="Shipping and Handling" name="item_name_<?php echo $i;?>">		
		<input type="hidden" value="<?php echo $shipping_cost;?>" name="amount_<?php echo $i;?>">		
		<input type="hidden" value="1" name="quantity_<?php echo $i;?>">		
		<input type="hidden" value="1" name="upload">
		<input TYPE="hidden" name="weight_unit" value="lbs">
		<input type="hidden" value="<?php echo Configure::read('base_url');?>" name="return">
		<input type="hidden" value="cart" name="type">
		<input type="hidden" value="_cart" name="cmd">
	</div>
	<div class="submit" style="display:none;">
		Processing order...
	<noscritp>
		<input type="submit" value="Buy Now">
	</noscritp>	
	</div>
</form>
<?php //echo $this->element('sql_dump'); ?>